import gevent
import time

def f1():
    print('start f1')
    gevent.sleep(10)
    print('end f1')


def f2():
    print('start f2')
    print('end f1')


def f3():
    print('start f3')
    gevent.sleep(20)
    print('end f3')



def main():
   gevent.joinall([gevent.spawn(f1),gevent.spawn(f2),gevent.spawn(f3)])


if __name__ == '__main__':
    main()